{include file="common/head_s"/} 
<div class="admin-main layui-anim layui-anim-upbit" ng-app="hd" ng-controller="ctrl">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>{$title}</legend>
    </fieldset>
    <form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">银行卡</label>
        <div class="layui-input-block">
          <select id="bankid" name="bankid" lay-verify="required" lay-filter="bankid">
            <option value=""></option>
            {volist name="bankinfo" id="bn"}
            <option value="{$bn.id}|{$bn.bankno}|{$bn.user}|{$bn.mobile}|{$bn.bankname}">{$bn.bankname}-{$bn.user}</option>
            {/volist}
          </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银行卡账号</label>
        <div class="layui-input-block">
          <input type="text" id="bankno" required lay-verify="required" placeholder="请输入银行卡账号" autocomplete="off" class="layui-input" disabled="">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">持卡人</label>
        <div class="layui-input-block">
          <input type="text" id="user" required lay-verify="required" placeholder="请输入持卡人" autocomplete="off" class="layui-input" disabled="">
    </div>
  </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银行预留手机号</label>
        <div class="layui-input-block">
          <input type="text" id="mobile" required lay-verify="required" placeholder="请输入银行预留手机号" autocomplete="off" class="layui-input" disabled="">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">提现金额</label>
        <div class="layui-input-block">
          <input type="text" id="cash"  name="cash" required lay-verify="required" placeholder="请输入提现金额" autocomplete="off" class="layui-input">
    </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">支付密码</label>
        <div class="layui-input-block">
          <input type="password" id="paypwd"  name="paypwd" required lay-verify="required" placeholder="请输入支付密码" autocomplete="off" class="layui-input">
    </div>
    </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <textarea name="note" placeholder="请输入内容" class="layui-textarea"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit  lay-filter="addbtn">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary" onclick="window.location='{:url('settle/index')}'">返回</button>
    </div>
  </div>
</form>
</div>
<script src="/static/common/js/angular.min.js"></script>
<script src="/static/plugins/layui/layui.js"></script> 
    <script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',function() { 
        layui.use(['form', 'layer'], function () {
            var form = layui.form, layer = layui.layer,$= layui.jquery;  
            form.on('select(bankid)', function(data) {
                var bankinfo = data.value.split("|");
                var bankno = bankinfo[1];
                var user = bankinfo[2];
                var mobile = bankinfo[3];
                if(bankinfo != ''){
                    $('#bankno').attr('value',bankno);
                    $('#user').attr('value',user);
                    $('#mobile').attr('value',mobile);
                }
            });

            form.on('submit(addbtn)', function(data){
                $.post("{:url('')}",data.field,function(res){ 
                    if(res.code==1){
                        layer.msg(res.msg,{time:2000,icon:1},function(){  
                            // parent.location.reload();
                            window.location=res.url;
                        });
                    }else{
                        layer.msg(res.msg,{time:1000,icon:2}); 
                    }
                });
                return false;
            // layer.msg(JSON.stringify(data.field));
            // return false;
          });
        });
    });
</script>
<script>
//Demo
layui.use('form', function(){
  var form = layui.form; 
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
 
});
</script>
</body>
</html>